﻿using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations.Schema;
using YiSha.Util;

namespace YiSha.Entity.SystemManage
{
    /// <summary>
    /// 菜单表
    /// </summary>
    [Table("SysMenu")]
    public class MenuEntity : BaseExtensionEntity
    {
        /// <summary>
        /// 上级ID
        /// </summary>
        [JsonConverter(typeof(StringJsonConverter))]
        public long? ParentId { get; set; }

        /// <summary>
        /// 菜单名称
        /// </summary>
        public string MenuName { get; set; }

        /// <summary>
        /// 菜单图标
        /// </summary>
        public string MenuIcon { get; set; }

        /// <summary>
        /// 菜单url
        /// </summary>
        public string MenuUrl { get; set; }

        /// <summary>
        /// 菜单重定向
        /// </summary>
        public string MenuTarget { get; set; }

        /// <summary>
        /// 排序码
        /// </summary>
        public int? MenuSort { get; set; }

        /// <summary>
        /// 菜单类型
        /// </summary>
        public int? MenuType { get; set; }

        /// <summary>
        /// 菜单状态
        /// </summary>
        public int? MenuStatus { get; set; }

        /// <summary>
        /// 授权
        /// </summary>
        public string Authorize { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 上级名称
        /// </summary>
        [NotMapped]
        public string ParentName { get; set; }
    }
}